.class public Lcom/waiqin365/h5/photo/acty/a;
.super Landroid/support/v4/view/PagerAdapter;


# static fields
.field static final synthetic a:Z


# instance fields
.field final synthetic b:Lcom/waiqin365/h5/photo/acty/CameraPreviewActivity;

.field private c:Landroid/content/Context;

.field private d:Landroid/view/LayoutInflater;

.field private e:Luk/co/senab/photoview/PhotoView;


# direct methods
.method static constructor <clinit>()V
    .locals 1

    const-class v0, Lcom/waiqin365/h5/photo/acty/CameraPreviewActivity;

    invoke-virtual {v0}, Ljava/lang/Class;->desiredAssertionStatus()Z

    move-result v0

    if-nez v0, :cond_0

    const/4 v0, 0x1

    :goto_0
    sput-boolean v0, Lcom/waiqin365/h5/photo/acty/a;->a:Z

    return-void

    :cond_0
    const/4 v0, 0x0

    goto :goto_0
.end method

.method public constructor <init>(Lcom/waiqin365/h5/photo/acty/CameraPreviewActivity;Landroid/content/Context;)V
    .locals 2

    iput-object p1, p0, Lcom/waiqin365/h5/photo/acty/a;->b:Lcom/waiqin365/h5/photo/acty/CameraPreviewActivity;

    invoke-direct {p0}, Landroid/support/v4/view/PagerAdapter;-><init>()V

    iput-object p2, p0, Lcom/waiqin365/h5/photo/acty/a;->c:Landroid/content/Context;

    iget-object v0, p0, Lcom/waiqin365/h5/photo/acty/a;->c:Landroid/content/Context;

    iget-object v1, p0, Lcom/waiqin365/h5/photo/acty/a;->c:Landroid/content/Context;

    const-string/jumbo v1, "layout_inflater"

    invoke-virtual {v0, v1}, Landroid/content/Context;->getSystemService(Ljava/lang/String;)Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Landroid/view/LayoutInflater;

    iput-object v0, p0, Lcom/waiqin365/h5/photo/acty/a;->d:Landroid/view/LayoutInflater;

    return-void
.end method

.method static synthetic a(Lcom/waiqin365/h5/photo/acty/a;)Luk/co/senab/photoview/PhotoView;
    .locals 1

    iget-object v0, p0, Lcom/waiqin365/h5/photo/acty/a;->e:Luk/co/senab/photoview/PhotoView;

    return-object v0
.end method

.method static synthetic a(Lcom/waiqin365/h5/photo/acty/a;Luk/co/senab/photoview/PhotoView;)Luk/co/senab/photoview/PhotoView;
    .locals 0

    iput-object p1, p0, Lcom/waiqin365/h5/photo/acty/a;->e:Luk/co/senab/photoview/PhotoView;

    return-object p1
.end method


# virtual methods
.method public destroyItem(Landroid/view/ViewGroup;ILjava/lang/Object;)V
    .locals 0

    check-cast p3, Landroid/view/View;

    invoke-virtual {p1, p3}, Landroid/view/ViewGroup;->removeView(Landroid/view/View;)V

    return-void
.end method

.method public getCount()I
    .locals 1

    iget-object v0, p0, Lcom/waiqin365/h5/photo/acty/a;->b:Lcom/waiqin365/h5/photo/acty/CameraPreviewActivity;

    iget-object v0, v0, Lcom/waiqin365/h5/photo/acty/CameraPreviewActivity;->a:Ljava/util/ArrayList;

    if-eqz v0, :cond_0

    iget-object v0, p0, Lcom/waiqin365/h5/photo/acty/a;->b:Lcom/waiqin365/h5/photo/acty/CameraPreviewActivity;

    iget-object v0, v0, Lcom/waiqin365/h5/photo/acty/CameraPreviewActivity;->a:Ljava/util/ArrayList;

    invoke-virtual {v0}, Ljava/util/ArrayList;->size()I

    move-result v0

    :goto_0
    return v0

    :cond_0
    const/4 v0, 0x0

    goto :goto_0
.end method

.method public instantiateItem(Landroid/view/ViewGroup;I)Ljava/lang/Object;
    .locals 8

    const v7, 0x7f0c00b8

    const/4 v6, -0x1

    const/4 v5, 0x0

    iget-object v0, p0, Lcom/waiqin365/h5/photo/acty/a;->d:Landroid/view/LayoutInflater;

    const v1, 0x7f03001c

    invoke-virtual {v0, v1, p1, v5}, Landroid/view/LayoutInflater;->inflate(ILandroid/view/ViewGroup;Z)Landroid/view/View;

    move-result-object v2

    sget-boolean v0, Lcom/waiqin365/h5/photo/acty/a;->a:Z

    if-nez v0, :cond_0

    if-nez v2, :cond_0

    new-instance v0, Ljava/lang/AssertionError;

    invoke-direct {v0}, Ljava/lang/AssertionError;-><init>()V

    throw v0

    :cond_0
    invoke-virtual {v2, v7}, Landroid/view/View;->findViewById(I)Landroid/view/View;

    move-result-object v0

    check-cast v0, Luk/co/senab/photoview/PhotoView;

    new-instance v1, Lcom/waiqin365/h5/photo/acty/b;

    invoke-direct {v1, p0}, Lcom/waiqin365/h5/photo/acty/b;-><init>(Lcom/waiqin365/h5/photo/acty/a;)V

    invoke-virtual {v0, v1}, Luk/co/senab/photoview/PhotoView;->setOnLongClickListener(Landroid/view/View$OnLongClickListener;)V

    iget-object v1, p0, Lcom/waiqin365/h5/photo/acty/a;->b:Lcom/waiqin365/h5/photo/acty/CameraPreviewActivity;

    iget-object v1, v1, Lcom/waiqin365/h5/photo/acty/CameraPreviewActivity;->a:Ljava/util/ArrayList;

    invoke-virtual {v1, p2}, Ljava/util/ArrayList;->get(I)Ljava/lang/Object;

    move-result-object v1

    check-cast v1, Lcom/waiqin365/h5/photo/acty/f;

    iget-object v1, v1, Lcom/waiqin365/h5/photo/acty/f;->a:Ljava/lang/String;

    new-instance v3, Ljava/io/File;

    invoke-direct {v3, v1}, Ljava/io/File;-><init>(Ljava/lang/String;)V

    invoke-virtual {v3}, Ljava/io/File;->isFile()Z

    move-result v4

    if-eqz v4, :cond_1

    invoke-virtual {v3}, Ljava/io/File;->exists()Z

    move-result v3

    if-nez v3, :cond_2

    :cond_1
    const-string/jumbo v3, "http://"

    invoke-virtual {v1, v3}, Ljava/lang/String;->startsWith(Ljava/lang/String;)Z

    move-result v3

    if-nez v3, :cond_2

    const-string/jumbo v3, "https://"

    invoke-virtual {v1, v3}, Ljava/lang/String;->startsWith(Ljava/lang/String;)Z

    move-result v3

    if-eqz v3, :cond_4

    :cond_2
    invoke-virtual {v0}, Luk/co/senab/photoview/PhotoView;->getScaleType()Landroid/widget/ImageView$ScaleType;

    move-result-object v3

    invoke-virtual {v0, v7, v3}, Luk/co/senab/photoview/PhotoView;->setTag(ILjava/lang/Object;)V

    sget-object v3, Landroid/widget/ImageView$ScaleType;->CENTER_INSIDE:Landroid/widget/ImageView$ScaleType;

    invoke-virtual {v0, v3}, Luk/co/senab/photoview/PhotoView;->setScaleType(Landroid/widget/ImageView$ScaleType;)V

    iget-object v3, p0, Lcom/waiqin365/h5/photo/acty/a;->c:Landroid/content/Context;

    invoke-static {v3}, Lcom/fiberhome/gaea/client/d/f;->a(Landroid/content/Context;)Lcom/fiberhome/gaea/client/d/f;

    move-result-object v3

    invoke-virtual {v3, v1}, Lcom/fiberhome/gaea/client/d/f;->b(Ljava/lang/String;)Lcom/squareup/picasso/RequestCreator;

    move-result-object v3

    invoke-virtual {v3, v1}, Lcom/squareup/picasso/RequestCreator;->tag(Ljava/lang/Object;)Lcom/squareup/picasso/RequestCreator;

    move-result-object v1

    new-instance v3, Lcom/waiqin365/h5/photo/acty/e;

    invoke-direct {v3, p0, v0}, Lcom/waiqin365/h5/photo/acty/e;-><init>(Lcom/waiqin365/h5/photo/acty/a;Luk/co/senab/photoview/PhotoView;)V

    invoke-virtual {v1, v0, v3}, Lcom/squareup/picasso/RequestCreator;->into(Landroid/widget/ImageView;Lcom/squareup/picasso/Callback;)V

    :cond_3
    :goto_0
    invoke-virtual {p1, v2, v5}, Landroid/view/ViewGroup;->addView(Landroid/view/View;I)V

    return-object v2

    :cond_4
    const-string/jumbo v3, "data:"

    invoke-virtual {v1, v3}, Ljava/lang/String;->indexOf(Ljava/lang/String;)I

    move-result v3

    if-eq v3, v6, :cond_5

    const-string/jumbo v3, ";base64,"

    invoke-virtual {v1, v3}, Ljava/lang/String;->indexOf(Ljava/lang/String;)I

    move-result v3

    if-eq v3, v6, :cond_5

    const-string/jumbo v3, ";base64,"

    invoke-virtual {v1, v3}, Ljava/lang/String;->indexOf(Ljava/lang/String;)I

    move-result v3

    const-string/jumbo v4, ";base64,"

    invoke-virtual {v4}, Ljava/lang/String;->length()I

    move-result v4

    add-int/2addr v3, v4

    invoke-virtual {v1}, Ljava/lang/String;->length()I

    move-result v4

    invoke-virtual {v1, v3, v4}, Ljava/lang/String;->substring(II)Ljava/lang/String;

    move-result-object v1

    invoke-static {v1, v5}, Landroid/util/Base64;->decode(Ljava/lang/String;I)[B

    move-result-object v1

    array-length v3, v1

    invoke-static {v1, v5, v3}, Landroid/graphics/BitmapFactory;->decodeByteArray([BII)Landroid/graphics/Bitmap;

    move-result-object v1

    if-eqz v1, :cond_3

    invoke-virtual {v0, v1}, Luk/co/senab/photoview/PhotoView;->setImageBitmap(Landroid/graphics/Bitmap;)V

    goto :goto_0

    :cond_5
    iget-object v1, p0, Lcom/waiqin365/h5/photo/acty/a;->b:Lcom/waiqin365/h5/photo/acty/CameraPreviewActivity;

    invoke-virtual {v1}, Lcom/waiqin365/h5/photo/acty/CameraPreviewActivity;->getResources()Landroid/content/res/Resources;

    move-result-object v1

    const v3, 0x7f02024f

    invoke-virtual {v1, v3}, Landroid/content/res/Resources;->getDrawable(I)Landroid/graphics/drawable/Drawable;

    move-result-object v1

    invoke-virtual {v0, v1}, Luk/co/senab/photoview/PhotoView;->setImageDrawable(Landroid/graphics/drawable/Drawable;)V

    goto :goto_0
.end method

.method public isViewFromObject(Landroid/view/View;Ljava/lang/Object;)Z
    .locals 1

    invoke-virtual {p1, p2}, Ljava/lang/Object;->equals(Ljava/lang/Object;)Z

    move-result v0

    return v0
.end method
